package khleuven.mondzorg.db.googlespreadsheet;

import java.util.ArrayList;
import java.util.Arrays;

import org.apache.http.NameValuePair;
import org.apache.http.client.utils.URLEncodedUtils;

public class GoogleNameValuePair implements NameValuePair {
	
	String value;
	String name;
	
	public GoogleNameValuePair(String name, String value) {
		this.name = name;
		this.value = value;
		
	}
	@Override
	public String getValue() {
		return value;
	}
	
	@Override
	public String getName() {
		return name;
	}

	public static String toURLparams(NameValuePair[] params) {
		ArrayList<NameValuePair> e = new ArrayList<NameValuePair>();
		e.addAll(Arrays.asList(params));
		return URLEncodedUtils.format(e, "utf-8");
	}
}